<template>
  <div>
    <!-- 搭建基本容器 -->
    <el-container>
      <el-header>
        <!-- 面包屑导航 -->
        <!-- 退出登录 -->
        XXX大型后台管理系统
        <el-button @click="logout">退出登录</el-button>
      </el-header>
      <el-container>
        <el-aside width="220px">
          <v-nav></v-nav>
        </el-aside>
        <el-main>
          <!-- 二级路由出口 -->
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import vNav from '../components/vNav.vue'
export default {
  data() {
    return {};
  },
  components:{
    vNav
  },
  methods: {
    logout() {
      // 通过vuex清除数据
      this.$store.commit('clearUserInfo');
      this.$router.push('/login');
    }
  }
};
</script>

<style scoped>
.el-header {
  background: pink;
}
</style>
